package logic

import "go-zero-real/api/demo/internal/types"

func (l *DemoLogic) Test(req *types.TestRequest) (resp *types.Response, err error) {
	resp = new(types.Response)

	// 使用数据库连接执行 SQL 操作
	var name string
	err = l.svcCtx.DB.QueryRow(&name, "SELECT username FROM user WHERE id=?", req.Name)
	if err != nil {
		return nil, err
	}

	//接收form-data参数

	resp.Message = name

	return resp, nil
}
